<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.chanyachting.emall.serviceImpl.*"%>
<%@ page import="com.chanyachting.emall.service.*"%>
<%@ page import="com.chanyachting.emall.dao.*"%>
<%@ page import="com.chanyachting.emall.domain.*"%>

<%
    String rootPathInclude2main = request.getContextPath();

	YellowPageService yellowService = new YellowPageServiceImpl();

	List<Yellowpagecategory> ypcglist = yellowService.getAllYellowpagecategory();

	Yellowpagecategory ypcg = null;
	String bcname=null;
	Integer bcId=null;
	if (null != ypcglist && ypcglist.size() > 0) {
		for (int j = 0; j < ypcglist.size(); j++) {
			ypcg = ypcglist.get(j);
			bcId = ypcg.getId();
			bcname = ypcg.getName();
			if( j%4 == 0){
%>
<li>
<%		
			}
%>
<p><strong><a href="<%=rootPathInclude2main%>/frontend/yellow/yellowPages.do?bcId=<%=bcId%>" title="<%=bcname%>"> <%=bcname%> </a></strong><br />
<%
			Yellowpagesubcategory ypsub = null;
			List<Yellowpagesubcategory> ypSublist = yellowService.getYellowpagesubcategory(bcId.toString());
			if (ypSublist != null && ypSublist.size() > 0) {
				for (int i = 0; i < ypSublist.size(); i++) {
					ypsub = ypSublist.get(i);
					Integer productcategoryId = ypsub.getId();
					String name = ypsub.getName();
%>
<a href="<%=rootPathInclude2main%>/frontend/yellow/yellowPages.do?productcategoryId=<%=productcategoryId%>" title="<%=name%>"><%=name%></a>
<%
	                if (i != ypSublist.size() - 1) {
%>
|
<%
	                }
				}
%>
<%
	        }
			
%>
</p>
<%
            if( j%4 ==3 ){
%>
</li>
<%            	
            }          
		}
	}
%>